﻿using MMS.Model.FormatModel;
using MMS.UI.Extension;
using MMS.UI.Helper;
using System;
using System.Web.Mvc;
using System.Web.WebPages;


namespace MMS.UI.Areas.Admin.Controllers
{
    public class PayInfoController : BaseController
    {
        #region 1.0 加载 列表 数据  +Index()
        public ActionResult Index()
        {
            return View();
        }
        #endregion

        #region 1.2 加载 列表 数据 +Index() +HttpPost
        /// <summary>
        /// 1.2 加载 列表 数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Index(FormCollection form)
        {
            int pageIndex = Request.Form["page"].AsInt();
            int pageSize = Request.Form["rows"].AsInt();
            //1.查询数据集合
            var pageData = OpeCur.GetAsync<PageData<Model.PayInfo>>("http://localhost:16824/api/PayInfo/GetWherePaged/" + pageIndex + "/" + pageSize);

            //2.转成json格式字符串
            var strJson = OpeCur.ToJson(pageData);
            return Content(strJson);
        }
        #endregion

    }
}
